﻿/*-----------------------------------------------
// File: ProjectileData.cs 
// Description: 抛射物基础数据 
// Author: Shaobing	492057342@qq.com
-----------------------------------------------*/
using UnityEngine;
using System.Collections;

namespace Battle.View
{

    public class ProjectileData : ParticleData {
        public float projFlyTime;
        public ProjectileFlyType projFlyType;
        public Vector3 initOffset;
        public string targetBindBone;

        public static ProjectileData CreateProjectileData(string id, float flytime, ProjectileFlyType flytype, Vector3 offset, string targetBone) {
            var dict = Dict.Blo.DictParticleBlo.GetParticle(id);
            if (dict != null) {
                var data = new ProjectileData();
                data.particleId = id;
                data.resUrl = dict.ResourcePath;
                data.duration = (float)dict.Duration;
                data.IsLoop = dict.IsLoop == 0 ? false : true;
                data.projFlyTime = flytime;
                data.projFlyType = flytype;
                data.initOffset = offset;
                data.targetBindBone = targetBone;
                return data;
            }
            return null;
        }
    }
    public class ProjectilePacket
    {
        public string sourceUid;
        public SkillType skillType;
        public string releaseId;
        public int targetFPId;
        public BattleCamp targetCamp;

        public ProjectileData projectileData;
        public ProjectilePacket(ProjectileData pd, string uid, SkillType st, string _releaseId, int fpid, BattleCamp camp) {
            projectileData = pd;
            sourceUid = uid;
            skillType = st;
            releaseId = _releaseId;
            targetFPId = fpid;
            targetCamp = camp;
        }

    }
}
